//
//  Person.m
//  05_homework_排序
//
//  Created by dllo on 16/7/8.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "Person.h"

@implementation Person

- (NSComparisonResult)compareAge:(Person *)anotherElement{
    if(self.age >= [anotherElement age]) {
        return NSOrderedDescending;
    } else {
        return NSOrderedAscending;
    }
}



- (NSComparisonResult)compareName:(Person *)anotherElement{
    if(self.name >= [anotherElement name]) {
        return NSOrderedDescending;
    } else {
        return NSOrderedAscending;
    }
}

- (NSComparisonResult)compareSex:(Person *)anotherElement{
    if(self.sex >= [anotherElement sex]) {
        return NSOrderedDescending;
    } else {
        return NSOrderedAscending;
    }
}




@end
